
<?php include("header.php"); ?>

<script type="text/javascript">

function addUser() {
    window.location.href = "<?php echo SITE_URL;?>?c=Member&a=form";
}
</script>
	<div class="one_third">
		<div class="box_tool">
			<div class="box_head"><?php echo _LB_TOOLBOX; ?></div>

			<div class="box_content">
                <a id="auto_port_add" href="#" onclick="addUser();">
					<?php echo _LB_ADD_MEMBER; ?>
				</a>
			</div>
		</div>
		<div class="spacer"></div>
		<div class="box_tool">
			<div class="box_head"><?php echo _LB_SEARCH; ?></div>
			<div class="box_content" id="filter_panel">
				<table>
				<form name='form_filter' method="post" action="">
				<tr>
					<td width="40%"><?php echo _LB_USERNAME; ?></td>
					<td width="60%">
						<input type="text" name="username" id="username" value="<?php echo $filter['username']; ?>" style="width: 180px;"/>
					</td>
				</tr>
				<tr>
					<td width="40%"><?php echo _LB_EMAIL; ?></td>
					<td width="60%">
						<input type="text" name="email" id="email" value="<?php echo $filter['email']; ?>" style="width: 180px;"/>
					</td>
				</tr>
				<tr>
					<td width="40%"><?php echo _LB_NAME; ?></td>
					<td width="60%">
						<input type="text" name="name" id="name" value="<?php echo $filter['name']; ?>" style="width: 180px;"/>
					</td>
				</tr>
				<tr>
					<td width="40%"><?php echo _LB_CARD_PASSPORT; ?></td>
					<td width="60%">
						<input type="text" name="indentify" id="indentify" value="<?php echo $filter['indentify']; ?>" style="width: 180px;"/>
					</td>
				</tr>
                <tr>
					<td class="submit" colspan="2" style="padding-top:10px;">
						<a id="auto_port_search" class="tribullet" style="float:right" id="obj_search" href="#" onclick="document.form_filter.submit();"><?php echo _LB_FIND;?></a>
					</td>
				</tr>
				</form>
				</table>
			</div>
		</div>
	</div>

	<div class="two_third" style="height:1%">
		<div class="box_two_third">
			<div class="box_head"><?php echo _LB_MEMBERS; ?></div>
			<div class="box_content">
			<?php if($user->countRows()) { ?>
					<?php while($user->fetchNext()) { ?>
					<div class="object" robotid="<?php echo $user->id; ?>">
						<div class="head">
							<div class="right remove_top">
								<a id="auto_user_change_password_<?php echo $user->id; ?>" href="<?php echo SITE_URL; ?>?c=Member&a=change_password&id=<?php echo $user->id; ?>">
                                    <img title="<?php echo _LB_CHANGE_PASSWORD; ?>" alt="" src="<?php echo SITE_URL;?>/images/<?php echo IMAGE_NAME_KEY_SMALL; ?>" class="small"/>
                                </a>
                                <a id="auto_port_edit_<?php echo $user->id;?>" href="<?php echo SITE_URL;?>?c=Member&a=form&id=<?php echo $user->id;?>">
									<img src="<?php echo SITE_URL;?>/images/<?php echo IMAGE_NAME_EDIT_SMALL;?>" title="<?php echo _LB_EDIT;?>" alt="<?php echo _LB_EDIT;?>"/>
								</a>
								<a id="auto_port_delete_<?php echo $user->id;?>" onclick="return confirm('<?php echo _MSG_DELETE_CONFIRM;?>');" href="<?php echo SITE_URL;?>?c=Member&a=delete&id=<?php echo $user->id;?>">
									<img src="<?php echo SITE_URL;?>/images/<?php echo IMAGE_NAME_DELETE_SMALL?>" title="<?php echo _LB_DELETE;?>" alt="<?php echo _LB_DELETE;?>"/>
								</a>
							</div>
							<img alt="" src="<?php echo SITE_URL; ?>/images/<?php echo IMAGE_NAME_USER; ?>" class="small"/><b><?php echo $user->username; ?></b>
						</div>
						<div class="content">
							<table border="0" cellpadding="3" cellspacing="0">
                                <tr>
									<td width="20%"><?php echo _LB_EMAIL;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->email; ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_CARD_PASSPORT;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->indentify; ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_FULL_NAME;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->fullname; ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_GENDER;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo ($user->sex == 1 ? _LB_MALE : ($user->sex == 0 ? _LB_FEMALE : _LB_UNKNOWN)); ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_DATE_OF_BIRTH;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->birthday; ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_ADDRESS;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->address; ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_PHONE;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->phone; ?>
									</td>
								</tr>
								<tr>
									<td width="20%"><?php echo _LB_MOBILE;?>&nbsp;:&nbsp;</td>
									<td>
										<?php echo $user->mobile; ?>
									</td>
								</tr>
							</table>
						</div>
					</div>
					<?php } ?>
			<?php } else { ?>
				<p><?php echo _MSG_NO_EXISTING_USER;?></p>
			<?php } ?>
			</div>
		</div>
		
	</div>
<div class="clear"></div>
<?php include("footer.php"); ?>
